home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / code_gen / codegen / codegen.mdb / snippet.json < prev    next >
Encoding:
JavaScript Object Notation  |  1995-09-07  |  21.2 KB

  1. {
  2.     "schema": {
  3.         "Catagory ID": "Long Integer",
  4.         "Name_Nbr": "Long Integer",
  5.         "Name": "Text (50)",
  6.         "Desc": "Text (255)",
  7.         "Code": "Memo/Hyperlink (255)"
  8.     },
  9.     "data": [
  10.         {
  11.             "Catagory ID": 2,
  12.             "Name_Nbr": 5,
  13.             "Name": "combo box - limit us",
  14.             "Desc": "sendmessage api to limit user input.",
  15.             "Code": "'DOCUMENT:Q72677  24-FEB-1994  [B_VBASIC]\r\n'TITLE   :How to Limit User Input in VB Combo Box with SendMessage API\r\n'SUMMARY\r\n'=======\r\n\r\n'You can specify a limit to the amount of text that can be entered into\r\n'a combo box by calling SendMessage (a Windows API function) with the\r\n'EM_LIMITTEXT constant.\r\n\r\n'The preferred method of performing this type of functionality is\r\n'to use the SendMessage API function call. After you set the focus to\r\n'the desired edit control, you must send a message to the window's\r\n'message queue that will reset the text limit for the control. The\r\n'argument EM_LIMITTEXT, as the second parameter to SendMessage, will\r\n'set the desired text limit based on the value specified by the third\r\n'arguments. The SendMessage function requires the following parameters\r\n'for setting the text limit:\r\n\r\nSendMessage (hWnd%,EM_LIMITTEXT, wParam%, lParam)\r\n\r\n'   wParam%   Specifies the maximum number of bytes that can be\r\n'             entered. If the user attempts to enter more characters,\r\n'             the edit control beeps and does not accept the characters.\r\n'             If the wParam parameter is zero, no limit is imposed on\r\n'             the size of the text (until no more memory is available).\r\n'   lParam    Is not used.\r\n\r\n\r\n'Add the following code to the general declarations section of Form1:\r\n\r\n'*** Note: Each Declare statement must be on just one line:\r\n\r\nDeclare Function GetFocus% Lib \"user\" ()\r\nDeclare Function SendMessage& Lib \"user\" (ByVal hWnd%, ByVal wMsg%, ByVal wParam%, lp As Any)\r\nConst WM_USER = &H400\r\nConst EM_LIMITTEXT = WM_USER + 21\r\n\r\n'Add the following code to the Form_Load event procedure:\r\n\r\nCombo1.SetFocus       ' Set the focus to the list box.\r\ncbhWnd% = GetFocus()  ' Get the handle to the list box.\r\nTextLimit% = 5        ' Specify the largest string.\r\nretVal& = SendMessage(cbhWnd%, EM_LIMITTEXT, TextLimit%, 0)\r\n"
  16.         },
  17.         {
  18.             "Catagory ID": 3,
  19.             "Name_Nbr": 6,
  20.             "Name": "form - making system",
  21.             "Desc": "shows how to make a form system modal.",
  22.             "Code": "'Microsoft Windows is designed so that the user can switch between\r\n'applications without terminating one program to run another program.\r\n'There may be times when the program needs to take control of the\r\n'entire environment and run from only one window, restricting the user\r\n'from switching to any other application. An example of this is a\r\n'simple security system, or a time-critical application that may need\r\n'to go uninterrupted for long periods of time.\r\n\r\n'Passing the handle to the window through the argument of\r\n'SetSysModalWindow will limit the user to that particular window. This\r\n'will not allow the user to move to any other applications with the\r\n'mouse or use ALT+ESC or CTRL+ESC to bring up the Task Manager. You can\r\n'even remove the system menu if you do not want the user to exit\r\n'through the ALT+F4 (Close) combination.\r\n\r\n'All child windows that are created by the system-modal window become\r\n'system-modal windows. When the original window becomes active again,\r\n'it is system-modal. To end the system-modal state, destroy the\r\n'original system-modal window.\r\n\r\n'Care must be taken when using the SetSysModalWindow API from within\r\n'the Visual Basic for Windows programming environment. Pressing\r\n'CTRL+BREAK to get to the [break] mode leaves your modal form with no\r\n'way to exit unless you restart your system. When using the\r\n'SetSysModalWindow within the environment, be sure to exit your\r\n'application by destroying the window with either the ALT+F4 in the\r\n'system menu, or by some other means from within your running program.\r\n\r\n'To use the SetSysModalWindow API function, declare the API call in\r\n'your global section, as follows:\r\n\r\nDeclare Function SetSysModalWindow Lib \"User\" (ByVal hwnd%) As Integer\r\n\r\n'At an appropriate place in your code, add the following:\r\n\r\nSuccess% = SetSysModalWindow(hwnd)\r\n\r\n'Once this line is executed, your window will be the only window that can get focus until that window is destroyed.\r\n'If you want to show another window from a system modal form, use another\r\n'Visual Basic for Windows form and call SetSysModalWindow for this second\r\n'form also, so that it becomes the system modal window. When the second\r\n'form is unloaded, the original system modal form will again become the\r\n'system modal window. Note that because the window(s) shown from a\r\n'system modal window must also call SetSysModalWindow, and since\r\n'MsgBox/InputBox windows cannot have associated code, you should not\r\n'call the MsgBox or InputBox functions from a system modal window.\r\n\r\n"
  23.         },
  24.         {
  25.             "Catagory ID": 3,
  26.             "Name_Nbr": 7,
  27.             "Name": "application - securi",
  28.             "Desc": "comments about how to secure an Access database.\r\nThere is no CODE in this.",
  29.             "Code": "'What we need is a way to totally prevent any tampering with the data or viewing of the data structure once the databases\r\n'are shipped with our  software, either from Access, VB or any other application.\r\n\r\n'This is what you should do.\r\n'1. Create the database, with tables, reports, forms etc.\r\n'2. Create a new user, say SUPERUSER and give him Admin access to the database\r\n'3. Login as SUPERUSER and import all objects from the database.\r\n'4. Delete the account Admin (or set his access to zero, can't remember which)\r\n'5. Ship the database with your system.mda - file\r\n\r\n'This will prevent Admin users on other Access-system to read the database, The\r\n'only way to access the database is to login as SUPERUSER and enter the correct\r\n'password. Don't forget the password!!\r\n"
  30.         },
  31.         {
  32.             "Catagory ID": 2,
  33.             "Name_Nbr": 8,
  34.             "Name": "api - amount of ram",
  35.             "Desc": "supposed to tell you the amount of ram (minus virtual) that is installed on your computer.\r\nI don't think this works.",
  36.             "Code": "'Could someone please tell me if there is an API call which detects the \r\n'amount of physical (not virtual) ram the computer has in it.\r\n\r\nDeclare Function GetFreeSpace& Lib \"Kernel\" (ByVal wFlags%)\r\n\r\nFreeMemory = Format$(GetFreeSpace(0) / 1024, \"###,###,###\") & \" KB Free\"\r\n\r\n"
  37.         },
  38.         {
  39.             "Catagory ID": 3,
  40.             "Name_Nbr": 9,
  41.             "Name": "api - get system res",
  42.             "Desc": "this should give the diskspace, memory ...",
  43.             "Code": "'I'm looking for a way to consult the available space in disk, in the  \r\n'windows api, and i didn't found anything.\r\n\r\n'--GET FREE GDI AND USR MEMORY\r\nDeclare Function GetFreeSystemResources Lib \"User\" (ByVal fuSysResource)\r\nGlobal Const GDI = 1\r\nGlobal Const USR = 2\r\n\r\n'--GET SYSTEM MEMORY\r\nDeclare Function GetFreeSpace Lib \"Kernel\" (ByVal wFlags) As Long\r\n\r\n'--FREE DISK SPACE\r\nDeclare Function DiskSpaceFree Lib \"SetupKit.DLL\" () As Long\r\n"
  44.         },
  45.         {
  46.             "Catagory ID": 3,
  47.             "Name_Nbr": 10,
  48.             "Name": "database - attaching",
  49.             "Desc": "shows how to attach to tables in another access database.",
  50.             "Code": "Here's the code I use.  You will want to change the names of the tables that are linked in.\r\n\r\nOption Compare Database   'Use database order for string comparisons\r\n\r\n' Module: Table Linking Module\r\n\r\n' This module will allow the user to easily set up links to the data file TIMEDATA.MDB without\r\n' the need to go into the application's design mode.  Change this filename to your own.\r\n\r\nFunction attach_tables ()\r\n    ' This routine by Mike Lyons\r\n    ' Last modified: Aug. 15, 1994\r\n    'Ask the user find TIMEDATA.MDB\r\n    db_loc$ = open_file(\"TIMEDATA.MDB\", CurDir$, \"Locate TIMEDATA.MDB for table link\")\r\n    If Len(db_loc$) > 0 Then ' If the user did not cancel or enter nothing\r\n       On Error GoTo err_hand        ' If an error occurs, go to error handler.\r\n       If Len(Dir$(db_loc$)) > 0 Then    'If the file was found...\r\n\t Call DelTables        ' Routine to delete any previous table links\r\n              'Attach the tables from the TIMEDATA.MDB file.\r\n               DoCmd TransferDatabase A_ATTACH, \"Microsoft Access\", db_loc$, A_TABLE, \"Main Data Table\", \"Main Data Table\"\r\n               DoCmd TransferDatabase A_ATTACH, \"Microsoft Access\", db_loc$, A_TABLE, \"Staff Table\", \"Staff Table\"\r\n\t DoCmd TransferDatabase A_ATTACH, \"Microsoft Access\", db_loc$, A_TABLE, \"Work Order Table\", \"Work Order Table\"\r\n\t MsgBox \"Operation complete.\", , \"Link Tables\"  ' Inform the user \r\n      Else\r\n\t msg = \"Could not find file \" + db_loc$\r\n\t MsgBox msg, , \"File not found\"\r\n      End If\r\n   End If\r\n   Exit Function\r\n\r\n'Error handling routine\r\nerr_hand:\r\n   If Err = 76 Then    ' The path as entered was not found\r\n      MsgBox \"Invalid path entered.\", , \"Disk Error\"\r\n   ElseIf Err = 53 Then    ' The path was OK but the file wasn't there.\r\n      MsgBox \"Could not find file \" + db_loc$, , \"File not found\"\r\n   Else\r\n      MsgBox \"Unknown error: Error # \" & Str$(Err) & \".\", , \"General error\"\r\n      MsgBox Error$(Err)\r\n\r\n   End If\r\n\r\n   Exit Function\r\n\r\n\r\nEnd Function\r\n\r\nSub DelTables ()\r\n  ' Written by Mike Lyons (modified from an example in the language reference)\r\n  ' Revised July 19, 1994\r\n\r\n  Dim db As Database, ssTableList As Snapshot\r\n  Set db = CurrentDB()\r\n  Set ssTableList = db.ListTables()\r\n  SendKeys \"{F11}\"       ' Call up the Database Window\r\n  Do Until ssTableList.EOF     ' Loop until the end of the ssTableList is reached\r\n\r\n    IsNotAQuery = ssTableList.TableType <> DB_QUERYDEF\r\n    IsNotASysObj = ((ssTableList.Attributes And DB_SYSTEMOBJECT) = 0)\r\n    If IsNotAQuery And IsNotASysObj Then 'Skip queries and system objects.\r\n       If ssTableList.Name <> \"Helpful Hints\" Then  ' Don't delete Helpful Hints\r\n\t   DoCmd SetWarnings False  ' Temporarily disable warning messages\r\n\t   DoCmd SelectObject A_TABLE, ssTableList.Name, True ' Select a table\r\n\t   SendKeys \"{DEL}\", True                      ' Delete tables\r\n\t   DoCmd SetWarnings True   ' Warnings enabled again.\r\n       End If\r\n    End If\r\n    ssTableList.MoveNext      'Move to the next field\r\n  Loop\r\n  SendKeys \"%WH\", True    ' Rehide the Database Window\r\n  ssTableList.Close\r\n\r\nEnd Sub\r\n\r\n' -- End of Table Linking Module --\r\n\r\n' Module: FileSelect\r\n\r\n' This routine was provided by a user on the Internet, and was subsequently modified\r\n' to adapt it to use in the Labour Distribution Database and to correct a few bugs\r\n' in the code.\r\n\r\nOption Compare Database\r\nOption Explicit\r\n\r\nType tagOPENFILENAME\r\n    lStructSize As Long\r\n    hwndOwner As Integer\r\n    hInstance As Integer\r\n    lpstrFilter As Long\r\n    lpstrCustomFilter As Long\r\n    nMaxCustFilter As Long\r\n    nFilterIndex As Long\r\n    lpstrFile As Long\r\n    nMaxFile As Long\r\n    lpstrFileTitle As Long\r\n    nMaxFileTitle As Long\r\n    lpstrInitialDir As Long\r\n    lpstrTitle As Long\r\n    Flags As Long\r\n    nFileOffset As Integer\r\n    nFileExtension As Integer\r\n    lpstrDefExt As Long\r\n    lCustData As Long\r\n    lpfnHook As Long\r\n    lpTemplateName As Long\r\nEnd Type\r\n\r\nDeclare Function lstrcpy Lib \"KERNEL.EXE\" (ByVal Dest As Any, ByVal Src As Any) As Long\r\nDeclare Function lstrcat Lib \"KERNEL.EXE\" (ByVal Dest As Any, ByVal Src As Any) As Long\r\nDeclare Function GetOpenFileName Lib \"COMMDLG.DLL\" (OPENFILENAME As tagOPENFILENAME) As Integer\r\n\r\nGlobal Const OFN_FILEMUSTEXIST = &H1000\r\nGlobal Const OFN_READONLY = &H1\r\n\r\nFunction open_file (filter$, szcurdir$, title$) As String\r\nDim OPENFILENAME As tagOPENFILENAME\r\nDim filename$, filetitle$, defext$\r\nDim apiresult%, x%\r\n\r\nfilter$ = filter$ + Chr$(0) + filter$ + String$(2, 0)\r\nfilename$ = Chr$(0) & Space$(255) & Chr$(0)\r\nfiletitle$ = Space$(255) & Chr$(0)\r\ntitle$ = title$ & Chr$(0)\r\ndefext$ = \"*\" & Chr$(0)\r\nszcurdir$ = szcurdir$ & \"\\\" & Chr$(0)' Was commented out\r\n\r\nOPENFILENAME.lStructSize = Len(OPENFILENAME)\r\nOPENFILENAME.hwndOwner = 0 'screen.activeform.hwnd\r\nOPENFILENAME.hInstance = 0\r\nOPENFILENAME.lpstrFilter = lstrcpy(filter$, filter$)\r\nOPENFILENAME.lpstrCustomFilter = 0\r\nOPENFILENAME.nMaxCustFilter = 0\r\nOPENFILENAME.nFilterIndex = 1\r\nOPENFILENAME.lpstrFile = lstrcpy(filename$, filename$)\r\nOPENFILENAME.nMaxFile = Len(filename$)\r\nOPENFILENAME.lpstrFileTitle = lstrcpy(filetitle$, filetitle$) ' Was commented and misspelled\r\nOPENFILENAME.nMaxFileTitle = Len(filetitle$) ' Was commented and misspelled\r\nOPENFILENAME.lpstrInitialDir = lstrcpy(szcurdir$, szcurdir$)\r\nOPENFILENAME.lpstrTitle = lstrcpy(title$, title$) ' Was commented and misspelled\r\nOPENFILENAME.Flags = OFN_FILEMUSTEXIST Or OFN_READONLY\r\nOPENFILENAME.nFileOffset = 0\r\nOPENFILENAME.nFileExtension = 0\r\nOPENFILENAME.lpstrDefExt = lstrcpy(defext$, defext$)\r\nOPENFILENAME.lCustData = 0\r\nOPENFILENAME.lpfnHook = 0\r\nOPENFILENAME.lpTemplateName = 0\r\n\r\napiresult% = GetOpenFileName(OPENFILENAME)\r\n\r\nIf apiresult% = 0 Then\r\n   open_file = \"\"\r\nElse\r\n   x% = InStr(filename$, Chr$(0))\r\n   If x% <> 0 Then\r\n      filename$ = Left$(filename$, x% - 1)\r\n   End If\r\n   open_file = filename$\r\nEnd If\r\n\r\nEnd Function\r\n\r\n\r\n"
  51.         },
  52.         {
  53.             "Catagory ID": 2,
  54.             "Name_Nbr": 13,
  55.             "Name": "menu - changing the ",
  56.             "Desc": "KB article on changing the checkbox bitmap in a menu item",
  57.             "Code": "'DOCUMENT:Q71281  24-FEB-1994  [B_VBASIC]\r\n'TITLE   :How to Implement a Bitmap Within a Visual Basic Menu\r\n\r\n'No command provided by the Visual Basic language can add a bitmap to\r\n'the menu system. However, you can call several Windows API functions\r\n'to place a bitmap within the menu system of a Visual Basic program. You\r\n'may also change the default check mark displayed.\r\n\r\n'There are several Windows API functions you can call that will display\r\n'a bitmap instead of text in the menu system.\r\n\r\n'Below is a list of the required Windows API functions:\r\n\r\n' - GetMenu% (hwnd%)\r\n\r\n'   hwnd%   -  Identifies the window whose menu is to be examined\r\n'   Returns:   Handle to the menu\r\n\r\n' - GetSubMenu% (hMenu%, nPos%)\r\n\r\n'   hMenu%  - Identifies the menu\r\n'   nPos%   - Specifies the position (zero-based) in the given menu of the pop-up menu\r\n'   Returns:  Handle to the given pop-up menu\r\n\r\n' - GetMenuItemID% (hMenu%, nPos%)\r\n\r\n'   hMenu%  - Identifies the handle to the pop-up menu that contains the item whose ID is being retrieved\r\n'   nPos%   - Specifies the position (zero-based) of the menu whose ID is being retrieved\r\n'   Returns:  The item ID for the specified item in the pop-up menu\r\n\r\n' - ModifyMenu% (hMenu%, nPos%, wFlags%, wIDNewItem%, lpNewItem&)\r\n\r\n'    hMenu%  - Identifies the handle to the pop-up menu that contains the item whose ID is being retrieved\r\n'    nPos%   - Specifies the menu item to be changed. The interpretation of the nPos parameter depends on the wFlags parameter.\r\n'    wFlags% - BF_BITMAP  =  &H4\r\n'    wIDNewItem% - Specifies the command ID of the modified menu item\r\n'    lpNewItem&  - 32-bit handle to the bitmap\r\n'    Returns:  TRUE (-1) if successful, FALSE (0) if unsuccessful\r\n\r\n' - SetMenuItemBitmaps% (hMenu%, nPos%, Flags%, hBitmapUnchecked%, hBitmapChecked%)\r\n\r\n'    hMenu%  - Identifies menu to be changed\r\n'    nPos%   - Command ID of the menu item\r\n'    wFlags% - &H0\r\n'    hBitmapUnchecked% - Handle to \"unchecked\" bitmap.\r\n'    hBitmapChecked%)  - Handle to the \"check\" bitmap.\r\n'    Returns: TRUE (-1) if successful, FALSE (0) if unsuccessful.\r\n\r\n'Define a menu system using the Menu Design window. Create a menu\r\n'system such as the following:\r\n\r\n'    Caption      Control Name   Indented     Index\r\n'    --------------------------------------------------------\r\n'    BitMenu      TopMenu        No\r\n'    Sub Menu0    SubMenu        Once         0\r\n'    Sub Menu1    SubMenu        Once         1\r\n'    Sub Menu2    SubMenu        Once         2\r\n\r\n'Create a picture control array with three bitmaps by creating three\r\n'picture controls with the same control Name using the Properties list box.\r\n\r\n'    Control Name   Caption   Index     FontSize\r\n'    ----------------------------------------------------------------\r\n'    Picture1                  0           N/A\r\n'    Picture1                  1           N/A\r\n'    Picture1                  2           N/A\r\n'    Picture2                  N/A         N/A  'check BMP\r\n'    Picture3                  0           'set Picture3 FontSize all\r\n'                                           different\r\n'    Picture3                  1           9.75\r\n'    Picture3                  2           18\r\n'    Command1       Static\r\n'    Command2       Dynamic\r\n'\r\n'For each control index of Picture1, add a valid bitmap to the Picture\r\n'property. Because these bitmaps will be displayed in the menu, you\r\n'should use smaller bitmaps. Add a bitmap to the Picture2 Picture\r\n'property that you want to be your check mark when you select a menu\r\n'option.\r\n\r\n'Both types of bitmap implementations will need to have the following\r\n'declarations in the declaration or global section of your code:\r\n\r\n' Enter each Declare statement on one, single line:\r\nDeclare Function GetMenu% Lib \"user\" (ByVal hwnd%)\r\nDeclare Function GetSubMenu% Lib \"user\" (ByVal hMenu%, ByVal nPos%)\r\nDeclare Function GetMenuItemID% Lib \"user\" (ByVal hMenu%, ByVal nPos%)\r\nDeclare Function ModifyMenu% Lib \"user\" (ByVal hMenu%, ByVal nPosition%, ByVal wFlags%, ByVal wIDNewItem%, ByVal lpNewItem&)\r\nDeclare Function SetMenuItemBitmaps% Lib \"user\" (ByVal hMenu%, ByVal nPosition%, ByVal wFlags%, ByVal hBitmapUnchecked%, ByVal BitmapChecked%)\r\nConst MF_BITMAP = &H4\r\nConst CLR_MENUBAR = &H80000004 ' Defined for dynamic bitmaps only.\r\nConst TRUE = -1, FALSE = 0\r\nConst Number_of_Menu_Selections = 3\r\n\r\n'The following Sub will also need to be defined to handle the actual\r\n'redefinition of the \"check\" bitmap:\r\n\r\nSub SubMenu_Click (Index As Integer)\r\n' Uncheck presently checked item, check new item, store  index\r\n   Static LastSelection%\r\n   SubMenu(LastSelection%).Checked = FALSE\r\n   SubMenu(Index).Checked = TRUE\r\n   LastSelection% = Index\r\nEnd Sub\r\n\r\nSub Command1_Click ()\r\n  '* example to create a static bitmap menu\r\n  hMenu% = GetMenu(hWnd)\r\n  hSubMenu% = GetSubMenu(hMenu%, 0)\r\n  For i% = 0 To Number_of_Menu_Selections - 1\r\n    menuId% = GetMenuItemID(hSubMenu%, i%)\r\n    x% = ModifyMenu(hMenu%, menuId%, MF_BITMAP, menuId%,\r\n                    CLng(picture1(i%).Picture))\r\n    x% = SetMenuItemBitmaps(hMenu%, menuId%, 0, 0,\r\n                    CLng(picture2.Picture))\r\n  Next i%\r\nEnd Sub\r\n\r\n'This code sample will change the actual menu bitmaps size,\r\n'font size, color, and caption. Run the application and\r\n'select the BitMenu and view the selections. Then click\r\n'the form and revisit the BitMenu.\r\n'---------------------------------------------------------\r\nSub Command2_Click ()\r\n   '* Example to create a dynamic menu system\r\n   hMenu% = GetMenu(hWnd)\r\n   hSubMenu% = GetSubMenu(hMenu%, 0)\r\n   For i% = 0 To Number_of_Menu_Selections - 1\r\n   '* Place some text into the menu.\r\n\r\n      SubMenu(i%).Caption = Picture3(i%).FontName +\r\n                Str$(Picture3(i%).FontSize) + \" Pnt\"\r\n\r\n   '* 1. Must be AutoRedraw for Image().\r\n   '* 2. Set Backcolor of Picture control to that of the\r\n   '*    current system Menu Bar color, so Dynamic bitmaps\r\n   '*    will appear as normal menu items when menu bar\r\n   '*    color is changed via the control panel\r\n   '* 3. See the bitmaps on screen, this could all be done\r\n   '*    at design time.\r\n\r\n     Picture3(i%).AutoRedraw = TRUE\r\n     Picture3(i%).BackColor = CLR_MENUBAR\r\n   '* You can uncomment this\r\n   '* Picture3(i%).Visible = FALSE\r\n\r\n   '* Set the width and height of the Picture controls\r\n   '* based on their corresponding Menu items caption,\r\n   '* and the Picture controls Font and FontSize.\r\n   '* DoEvents() is necessary to make new dimension\r\n   '* values to take affect prior to exiting this Sub.\r\n\r\n    Picture3(i%).Width = Picture3(i%).TextWidth(SubMenu(i%).Caption)\r\n    Picture3(i%).Height = Picture3(i%).TextHeight(SubMenu(i%).Caption)\r\n    Picture3(i%).Print SubMenu(i%).Caption\r\n\r\n   '* - Set picture controls backgroup picture (Bitmap) to\r\n   '*   its Image.\r\n     Picture3(i%).Picture = Picture3(i%).Image\r\n     x% = DoEvents()\r\n   Next i%\r\n\r\n    '* Get handle to forms menu.\r\n   hMenu% = GetMenu(Form1.hWnd)\r\n\r\n   '* Get handle to the specific menu in top level menu.\r\n   hSubMenu% = GetSubMenu(hMenu%, 0)\r\n\r\n   For i% = 0 To Number_of_Menu_Selections - 1\r\n\r\n   '* Get ID of sub menu\r\n     menuId% = GetMenuItemID(hSubMenu%, i%)\r\n\r\n   '* Replace menu text w/bitmap from corresponding picture\r\n   '* control\r\n     x% = ModifyMenu(hMenu%, menuId%, MF_BITMAP, menuId%,\r\n              CLng(Picture3(i%).Picture))  'append this to previous line\r\n\r\n   '* Replace bitmap for menu check mark with custom check\r\n   '* bitmap\r\n     x% = SetMenuItemBitmaps(hMenu%, menuId%, 0, 0, CLng(picture2.Picture))\r\n   Next i%\r\nEnd Sub\r\n"
  58.         },
  59.         {
  60.             "Catagory ID": 3,
  61.             "Name_Nbr": 17,
  62.             "Name": "test",
  63.             "Desc": "test",
  64.             "Code": "Print Database Reports\r\n\tAccess\r\n\tdbase III\r\n\tdbase IV\r\n\tODBC\r\n\tParadox 3.X\r\n\r\n"
  65.         }
  66.     ]
  67. }